﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;


namespace ArcEngine
{
	static public class Maths
	{
		/// <summary>
		/// Dot product
		/// Dot product of (x1, y1) and (x2, y2) is x1*x2 + y1*y2. 
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		static public int Dot(Point a, Point b)
		{
			return (a.X + b.X) * (a.Y + b.Y);
		}


		/// <summary>
		/// Cross Product
		/// The cross product of two 2-D vectors is x1*y2 - y1*x2 
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		static public int CrossProduct(Point a, Point b)
		{
			return (a.X * b.Y) - (a.Y * b.X);
		}


		/// <summary>
		/// Distance between to points
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		static public int Distance(Point a, Point b)
		{

			
			return (int)Math.Sqrt((a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y));
		}


	}
}
